package orchestration.android.demo;

import java.util.ArrayList;
import java.util.List;

import android.app.Service;
import android.content.Intent;
import android.net.Uri;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

public class RecieveAndTransmitService extends Service {
	private static final String TAG="Receive And Transmit Service";
	
	@SuppressWarnings("unchecked")
	private IBinder binder= new IReceiveAndTransmit.Stub() {
		
		@Override
		public Uri rAtUri(Uri u) throws RemoteException {
				Log.w(TAG, u.toString());
			return u;
		}
		
		@Override
		public String rAtString(String s) throws RemoteException {
			Log.w(TAG, s);
			return s;
		}
		
		@Override
		public long rAtLong(long l) throws RemoteException {
			Log.w(TAG, ""+l);
			return l;
		}
		
		@Override
		public int rAtInt(int i) throws RemoteException {
			Log.w(TAG, ""+i);
			return i;
		}
		
		@Override
		public double rAtDouble(double d) throws RemoteException {
			Log.w(TAG, ""+d);
			return d;
		}

		@Override
		public double createDouble() throws RemoteException {
			return 1.5;
		}

		@Override
		public int createInt() throws RemoteException {
			return 10;
		}

		@Override
		public long createLong() throws RemoteException {
			return 60L;
		}

		@Override
		public String createString() throws RemoteException {
			return "hola!";
		}

		
		@Override
		public Uri createUri() throws RemoteException {
			return Uri.parse("content://mundo.de.android/hola");
		}

		@Override
		public Uri[] createUriArray() throws RemoteException {
			return new Uri[]{Uri.parse("content://mundo.de.android/hola")};
		}

		@Override
		public Uri[] rAtUriArray(Uri[] uris) throws RemoteException {
			return uris;
		}

		@Override
		public List<Uri> createUriList() throws RemoteException {
			ArrayList<Uri> list= new ArrayList<Uri>();
			list.add(Uri.parse("content://mundo.de.android/hola"));
			return list;
		}

		@Override
		public List<Uri> rAtUriLisr(List<Uri> uris) throws RemoteException {
			return uris;
		}

		@Override
		public double[] creatDoubleArray() throws RemoteException {
			return new double[]{0.3,0.5};
		}

		@Override
		public String[] createStringArray() throws RemoteException {
			return new String[]{"Holaaa","erge"};
		}

		@Override
		public int[] createintArray() throws RemoteException {
			return new int[]{2,5};
		}

		@Override
		public double[] rAtDoubleArray(double[] arr) throws RemoteException {
			return arr;
		}

		@Override
		public String[] rAtStringArray(String[] arr) throws RemoteException {
			return arr;
		}

		@Override
		public int[] rAtintArray(int[] arr) throws RemoteException {
			return arr;
		}

		@Override
		public List<String> createStringList() throws RemoteException {
			ArrayList<String> arrayList = new ArrayList<String>();
			arrayList.add("holaaaa");
			return arrayList;
		}

		@Override
		public List<String> rAtStringList(List<String> list)
				throws RemoteException {
			return list;
		}

		@Override
		public List createList() throws RemoteException {
			ArrayList<Integer> arrayList = new ArrayList<Integer>();
			arrayList.add(567);
			return arrayList;
		}

		
		@Override
		public List rAtList(List list) throws RemoteException {
			return list;
		}
	};
	@Override
	public IBinder onBind(Intent arg0) {
		return binder;
	}

}
